<template>
  <div>
      <div class="item" v-for="(item,index) in list" :key="index" @click="Tiao(item)">
          
          <img :src="$pre +item.img" alt="">
          <div>{{item.goodsname}}</div>
       
      </div>
      
      <div v-if="list.length == 0">暂无数据</div>
  </div>
</template>

<script>
export default {
    props:["list"],
    methods:{
        Tiao(item){
            this.$router.push('/detail?id='+item.id)
        }
    }
};
</script>

<style>
.item {
  padding: 0.2rem;
  margin: 0.2rem;
  border: 0.01rem solid #ccc;
}
.item img {
  width: 1rem;
  height: 1rem;
}
</style>